<ui:component xmlns="http://www.w3.org/1999/xhtml"
              xmlns:ui="http://java.sun.com/jsf/facelets"
              xmlns:h="http://java.sun.com/jsf/html"
              xmlns:f="http://java.sun.com/jsf/core"
              xmlns:p="http://primefaces.org/ui"
              xmlns:composite="http://java.sun.com/jsf/composite">

    <composite:interface>
        <composite:attribute name="actionButtonId" required="true" />
        <composite:attribute name="widgetVar" required="true" />
        <composite:attribute name="title" required="true" />
        <composite:attribute name="message" required="true" />
        <composite:attribute name="render" default="true" />
        <composite:attribute name="severity" default="alert" />
        <composite:attribute name="styleClass" />
    </composite:interface>

    <composite:implementation>
        <p:confirmDialog id="#{cc.attrs.widgetVar}Dialog" header="#{cc.attrs.title}" severity="#{cc.attrs.severity}" rendered="#{cc.attrs.render}"
                         widgetVar="#{cc.attrs.widgetVar}" styleClass="confirmationDialog questionDialogIcon #{cc.attrs.styleClass}" closable="false">
            <f:facet name="message">
                <h:outputText value="#{cc.attrs.message}" escape="false" />
            </f:facet>
            <h:form id="#{cc.attrs.widgetVar}DialogForm">
                <p:commandButton value="#{msg['Common.yes']}" onclick="#{cc.attrs.widgetVar}.hide();$(PrimeFaces.escapeClientId('#{cc.attrs.actionButtonId}')).click();return false;" />
                <p:commandButton value="#{msg['Common.no']}" onclick="#{cc.attrs.widgetVar}.hide();return false;" />
            </h:form>
        </p:confirmDialog>
    </composite:implementation>
</ui:component>